package cn.myjerry.templateMethod;

public class Client {
	public static void main(String[] args) {
		BankTemplateMethod dtm = new DrawMoney();
		dtm.process();
		System.out.println("+++++++++");
		// 匿名内部类
		BankTemplateMethod btm2 = new BankTemplateMethod() {
			@Override
			public void transact() {
				System.out.println("我要存钱");
			}
		};
		btm2.process();
		System.out.println("+++++++++");
		BankTemplateMethod btm3 = new BankTemplateMethod() {
			@Override
			public void transact() {
				System.out.println("我要理财");
			}
		};
		btm3.process();
		
	}
}

class DrawMoney extends BankTemplateMethod {

	@Override
	public void transact() {
		System.out.println("取钱");
	}
	
}
